home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Utilities / BenchMarks / ByteBenchmark / pgms / loopm.awk < prev    next >
Text File  |  1994-01-27  |  2KB  |  59 lines

  1. ###############################################################################
  2. #  The BYTE UNIX Benchmarks - Release 1
  3. #          Module: loopm.awk   SID: 1.4 5/15/91 19:30:25
  4. #      LOOPS per minute
  5. #          
  6. ###############################################################################
  7. # Bug reports, patches, comments, suggestions should be sent to:
  8. #
  9. #    Ben Smith or Tom Yager at BYTE Magazine
  10. #    ben@bytepb.byte.com   tyager@bytepb.byte.com
  11. #
  12. ###############################################################################
  13. #  Modification Log:
  14. #        created 2/12/91 -ben
  15. #
  16. ###############################################################################
  17. BEGIN { rsum = 0.000; r2sum = 0.000; r_product = 0.0000;
  18.       iter = 0; Test=""; SubTest=""; secs = 0.00; secs_sum = 0.00;
  19.       mins = 0.000; time_str=""; flavor="SysV";
  20.     }
  21. /TEST\|/ { split($0, junk,"|");
  22.     Test=junk[2]; 
  23.     }
  24. /FLAVOR\|/ { split($0, junk,"|");
  25.     flavor=junk[2] ; 
  26.     }
  27. /loops/ { loops=$1; 
  28.     iter ++;
  29.         }
  30. /real/    { if (flavor == "SysV") {time_str = $2; }
  31.       else { time_str = $1; }
  32.     # determine seconds from time_str
  33.     if ( time_str ~/\:/)
  34.        {
  35.        split(time_str,junk,":");
  36.        secs = 60 * junk[1] + junk[2];
  37.        }
  38.     else { secs = time_str; }
  39.     mins=secs/60.000; 
  40.     print mins;
  41.     if(loops) { rsum += loops/mins;
  42.         r2sum += (loops*loops)/(mins*mins);
  43.         r_product += (log(loops)-log(mins));
  44.         secs_sum += secs;
  45.         }
  46.     }  
  47. /user/    { if (flavor == "SysV") { next;} } # don't use these times
  48. /sys/    { if (flavor == "SysV") { next;} } # don't use these times
  49. #/^$/    { next } 
  50. END {
  51.     if (iter > 0) {  
  52. # TestName|Sample(seconds)|units|ArithMean|GeoMean|DataPoints
  53.         printf("%s|%.1f|lpm|%.1f|%.1f|%d\n",Test,secs_sum/iter,rsum/iter,exp(r_product/iter),iter);
  54.         }
  55.     else { 
  56.         printf("%s|  no measured results|\n",Test); 
  57.         }
  58.     }
  59.